class HcClickUtil {
  HcClickUtil._();

  //最后点击时间
  static DateTime? _finalClickTime;

  ///是否允许响应
  ///[milliseconds] 响应间隔 默认500毫秒
  static bool enableResponses({int milliseconds = 500}) {
    if (_finalClickTime == null ||
        DateTime.now().difference(_finalClickTime!) >
            Duration(milliseconds: milliseconds)) {
      _finalClickTime = DateTime.now();
      // print("间隔可以响应");
      return true;
    }
    // print("双击不可响应");
    return false;
  }
}
